package com.justgame.project.service.system.feign;

import com.justgame.project.cloud.common.constant.AppConstant;
import com.justgame.project.service.system.entity.SysUserInfo;
import com.justgame.project.service.system.feign.fallback.SysUserInfoClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * SysUserInfo 微服务接口
 * @author ZhouWeiBo
 * @create 2022/4/11
 */
@FeignClient( value = AppConstant.SYSTEM , fallback = SysUserInfoClientFallback.class)
public interface ISysUserInfoClient {
    String API_PREFIX = "/feign/sys-user-info";
    String UPDATE_BY_ID = API_PREFIX + "/update-login-info";
    String GET_USER_INFO_BY_ID = API_PREFIX + "/get-by-id";

    /**
     * 通过id查询用户信息
     * @param id
     * @return
     */
    @RequestMapping(GET_USER_INFO_BY_ID)
    SysUserInfo getUserInfoById(@RequestParam("id") Long id);

    /**
     * 更新用户最后登录日期
     */
    @RequestMapping(UPDATE_BY_ID)
    boolean updateById(@RequestBody SysUserInfo userInfo);
}
